package com.starry.home.ui.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * Package:com.starry.dotpen_patients.ui.adapter
 * Author:starr
 * Time:2024/1/4 16:26
 * Description:
 */
class ViewPager2Adapter(
    fragment: FragmentActivity,
    private val fragments: MutableList<Fragment>
) : FragmentStateAdapter(fragment) {
    override fun getItemCount() = fragments.size

    override fun createFragment(position: Int): Fragment {
        return fragments[position]
    }
}